/* Author : Putri Andita R
 * 		    091511059
 * Proyek 4*/


package jtk.project4.fleet.field;

import java.awt.FlowLayout;

import jtk.project4.fleet.action.AddPMServicesAction;
import jtk.project4.fleet.action.AddPMServicesAction;
import jtk.project4.fleet.action.EditPMServicesAction;
import jtk.project4.fleet.action.EditScheduleAction;

import nl.coderight.jazz.action.Action;
import nl.coderight.jazz.form.FormField;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.button.PushButton;


public class PMServicesField extends GroupControl{
	
	private PushButton addButton;
	private PushButton editButton;
	private PushButton deleteButton;
	private PushButton importButton;
	private PushButton printButton;
	private PushButton pmServicesButton;
	private Action AddPMServicesAction;
	private Action EditPMServicesAction;

	
	public PMServicesField(String bindID){
		setTitle("header.pmServices");
		setBindID(bindID);
		createAction();
		createFields();
		createLayout();
	}	
	
	private void createAction() {
		// TODO Auto-generated method stub
		AddPMServicesAction = new AddPMServicesAction();
		EditPMServicesAction = new EditPMServicesAction();
		
	}
	
	private void createFields() {
		pmServicesButton = new PushButton("pmServicesAction : ");
		addButton = new PushButton(AddPMServicesAction);
		editButton = new PushButton(EditPMServicesAction);
		deleteButton = new PushButton("deleteAction");
		importButton = new PushButton("importAction");
		printButton = new PushButton("printAction");
		}
	
		
	
	private void createLayout() {
		// TODO Auto-generated methodstub
		addField(createForm());
		}
	


	private GroupControl createButtons() {
		GroupControl buttons = new GroupControl();
		buttons.setLayout(new FlowLayout(FlowLayout.RIGHT));
		buttons.addField(pmServicesButton);
		buttons.addField(addButton);
		buttons.addField(editButton);
		buttons.addField(deleteButton);
		buttons.addField(importButton);
		buttons.addField(printButton);
		
		return buttons;
		}


	private FormField createForm()
	{
		GroupControl form = new GroupControl();
	form.addField(createButtons(), SOUTH);
	return form;
	}
}
		
	
	
	